package com.lcxw.hxzbadmin.service.configservice;

import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbadmin.dao.configmapper.BaseConfigMapper;
import com.lcxw.hxzbadmin.entity.configbean.CacheConfig;
import com.lcxw.hxzbadmin.entity.configbean.LiveConfig;
import com.lcxw.hxzbadmin.entity.configbean.RegisterConfig;
import com.lcxw.hxzbadmin.entity.configbean.SEOConfig;
import com.lcxw.hxzbadmin.entity.configbean.ShareConfig;
import com.lcxw.hxzbadmin.entity.configbean.YwpdBaseConfig;

@Component
public class BaseConfigService {

    @Resource
    BaseConfigMapper baseConfigMapper;

    public int updateBaseConfigByPrimaryKey(YwpdBaseConfig record) throws Exception {
        return baseConfigMapper.updateBaseConfigByPrimaryKey(record);
    }

    public YwpdBaseConfig selectBaseConfigByPrimaryKey() throws Exception {
        return baseConfigMapper.selectBaseConfigByPrimaryKey();
    }

    public int updateSEOConfigByPrimaryKey(SEOConfig record) throws Exception {
        return baseConfigMapper.updateSEOConfigByPrimaryKey(record);
    }

    //查询SEO相关设置
    public SEOConfig selectSEOConfigByPrimaryKey() throws Exception {
        return baseConfigMapper.selectSEOConfigByPrimaryKey();
    }

    //设置注册相关设置
    public int updateRegisterConfigByPrimaryKey(RegisterConfig record) throws Exception {
        return baseConfigMapper.updateRegisterConfigByPrimaryKey(record);
    }

    //查询注册相关设置
    public RegisterConfig selectRegisterConfigByPrimaryKey() throws Exception {
        return baseConfigMapper.selectRegisterConfigByPrimaryKey();
    }

    //设置直播相关配置
    public int updateLiveConfigByPrimaryKey(LiveConfig record) throws Exception {
        return baseConfigMapper.updateLiveConfigByPrimaryKey(record);
    }
    //查询直播相关配置
    public LiveConfig selectLiveConfigByPrimaryKey() throws Exception{
        return baseConfigMapper.selectLiveConfigByPrimaryKey();
    }

    //修改缓存机制配置参数
    public int updateCacheConfigByPrimaryKey(CacheConfig record)throws Exception{
        return baseConfigMapper.updateCacheConfigByPrimaryKey(record);
    }

    //查询缓存相关设置
    public CacheConfig selectCacheConfigByPrimaryKey() throws Exception{
        return baseConfigMapper.selectCacheConfigByPrimaryKey();
    }

    //修改收入分成配置参数
    public int updateShareConfigByPrimaryKey(ShareConfig record)throws Exception{
        return baseConfigMapper.updateShareConfigByPrimaryKey(record);
    }

    //查询收入分成设置
    public ShareConfig selectShareConfigByPrimaryKey() throws Exception{
        return baseConfigMapper.selectShareConfigByPrimaryKey();
    }


}
